import Vue from "vue";

import VueRouter from "vue-router";
import Login from "@/views/login/index.vue"
import Layout from "@/components/Layout.vue"
import Index from "../views/index"
import Books from "../views/books"
import Delivered from "../views/delivered"
import Processing from "../views/processing"
import Statistics from "../views/statistics"
import Vips from "../views/vips"
import Logs from "../views/logs"


Vue.use(VueRouter);


const routes = [
  {
    path: '/login',
    name: 'login',
    component: Login
  },
  {
    path: '/',
    name: 'layout',
    component: Layout,
    redirect:'/index',
    children: [
      {
        path: '/index',
        component: Index,
        meta:{title:'首页'}
      },
      {
        path: '/books',
        component: Books,
        meta:{title:'图书'}
      },
      {
        path: '/vips',
        component: Vips,
        meta:{title:'用户'}
      },
      {
        path: '/processing',
        component: Processing,
        meta:{title:'待配送'}
      },
      {
        path: '/delivered',
        component: Delivered,
        meta:{title:'已完结'}
      },
      {
        path: '/statistics',
        component: Statistics,
        meta:{title:'统计'}
      },
      {
        path: '/logs',
        component: Logs,
        meta:{title:'日志'}
      }
    ]
  }
];

const router = new VueRouter({
  //mode: "history",
  base: process.env.BASE_URL,
  routes
});

export default router;